<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Easy
  </div>
  <div>
   <h1 class="question_title">
    193. Valid Phone Numbers
   </h1>
   <p>
    Given a text file
    <code>
     file.txt
    </code>
    that contains list of phone numbers (one per line), write a one liner bash script to print all valid phone numbers.
   </p>
   <p>
    You may assume that a valid phone number must appear in one of the following two formats: (xxx) xxx-xxxx or xxx-xxx-xxxx. (x means a digit)
   </p>
   <p>
    You may also assume each line in the text file must not contain leading or trailing white spaces.
   </p>
   <p>
    <strong>
     Example:
    </strong>
   </p>
   <p>
    Assume that
    <code>
     file.txt
    </code>
    has the following content:
   </p>
   <pre>
987-123-4567
123 456 7890
(123) 456-7890
</pre>
   <p>
    Your script should output the following valid phone numbers:
   </p>
   <pre>
987-123-4567
(123) 456-7890
</pre>
  </div>
  <div>
   <h1 class="question_title">
    193. 有效电话号码
   </h1>
   <p>
    给定一个包含电话号码列表（一行一个电话号码）的文本文件
    <code>
     file.txt
    </code>
    ，写一个 bash 脚本输出所有有效的电话号码。
   </p>
   <p>
    你可以假设一个有效的电话号码必须满足以下两种格式： (xxx) xxx-xxxx 或&nbsp;xxx-xxx-xxxx。（x 表示一个数字）
   </p>
   <p>
    你也可以假设每行前后没有多余的空格字符。
   </p>
   <p>
    <strong>
     示例:
    </strong>
   </p>
   <p>
    假设&nbsp;
    <code>
     file.txt
    </code>
    &nbsp;内容如下：
   </p>
   <pre>987-123-4567
123 456 7890
(123) 456-7890
</pre>
   <p>
    你的脚本应当输出下列有效的电话号码：
   </p>
   <pre>987-123-4567
(123) 456-7890
</pre>
  </div>
 </body>
</html>